﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TrackingItemEdit.ascx.cs" Inherits="NLUNZ.UserControls.TrackingItemEdit" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<style type="text/css">
    .search-item-result {
        padding: 20px;
        font-size: 12px;
    }
    #resultItem .field-title {
        width:150px; 
        text-align: right;
        height: 35px;
        padding:5px 20px 5px 5px;
        vertical-align: top;
    }
    .resultcell 
    {
        padding: 8px 16px;
    }
</style>
<div style="text-align: center; font-weight: bold; font-size: 16px; margin: 20px 10px 10px 10px;">跟踪记录查询更新</div>
<div style="padding:20px; line-height: 12px; vertical-align: top;">
    <span style="padding-right:10px;">输入查询运单号码:</span> <span style="padding-left:10px;padding-right: 20px;">
<asp:TextBox ID="txtDeliverySearchBox" runat="server" Width="200px" 
        AutoPostBack="True"></asp:TextBox></span>
    <asp:Button ID="Button1" runat="server" Text="查询" Height="25px" 
        Width="80px" onclick="Button1_Click" />
</div>
<div class="search-item-result" style="margin-left: 0 !important;">
    <div id="resultItem" runat="server">
        <div class="resultSet">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="ID" DataSourceID="LinqDataSource1" 
                EnableModelValidation="True" CellPadding="3" 
                GridLines="Horizontal" Width="700px" BackColor="White" 
                BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px">
                <AlternatingRowStyle BackColor="#F7F7F7" />
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" >
                    <ItemStyle CssClass="resultcell" />
                    </asp:CommandField>
                    <asp:BoundField DataField="DeliveryNumber" HeaderText="运单号" 
                        SortExpression="DeliveryNumber" ReadOnly="True" >
                    <HeaderStyle CssClass="resultcell" />
                    <ItemStyle CssClass="resultcell" Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="TrackingDateTime" HeaderText="跟踪时间" 
                        SortExpression="TrackingDateTime" DataFormatString="{0:dd/MM/yyyy HH:mm}" >
                    <HeaderStyle CssClass="resultcell" />
                    <ItemStyle CssClass="resultcell" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CompanyCode" HeaderText="公司代码" 
                        SortExpression="CompanyCode" >
                    <HeaderStyle CssClass="resultcell" />
                    <ItemStyle CssClass="resultcell" />
                    </asp:BoundField>
                    <asp:BoundField DataField="TrackingNumber" HeaderText="跟踪号码" 
                        SortExpression="TrackingNumber" >
                    <HeaderStyle CssClass="resultcell" />
                    <ItemStyle CssClass="resultcell" />
                    </asp:BoundField>
                </Columns>
                <EmptyDataTemplate><div class="update-info">
                    没有运单跟踪记录。</div>
                </EmptyDataTemplate>
                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
            </asp:GridView>
            <asp:LinqDataSource ID="LinqDataSource1"  
                ContextTypeName="NLUNZ.Business.NLUDBDataContext" TableName="Trackings"  
                runat="server" EnableDelete="True" EnableInsert="True" EnableUpdate="True" 
                Where="DeliveryNumber == @DeliveryNumber">
                <WhereParameters>
                    <asp:ControlParameter ControlID="txtDeliverySearchBox" Name="DeliveryNumber" 
                        PropertyName="Text" Type="String" />
                </WhereParameters>
            </asp:LinqDataSource>
        </div>
    </div>
    <div id="emptyItem" runat="server">
        <div class="info-message"><div class="info-icon"></div>
        没有结果，请确认运单号码。
        </div> 
    </div>
</div>